-- damage_debuff
-- create by zhuangsl
-- 赋予敌方负面状态

return {
    apply = function(source, target, skillId, round, para, value)
        -- 0伤害、0治疗
        local ret = { ["damage"] = 0, ["cure"] = 0,};

        -- value = 0，表示这次附加属性被免疫了
        if value == 0 then
            ret["immunity"] = true;
        end

        return ret;
    end,

    parse = function(desc)
        local arr = string.explode(desc, ",");
        return { tonumber(arr[1]), arr[2], tonumber(arr[3]), tonumber(arr[4]), arr[5], };
    end,

    getDetail = function(para)
        -- 直接取prop描述
        return PropM.getPropDesc(para);
    end,

    getShipgunDetail = function(para, rate)
        -- 飞艇主炮描述
        local desc = getLocStr("shipskill_debuff");
        local alias = PropM.getPropAlias(para[1]);

        return string.format(desc, rate, alias);
    end,

    parseDesc = function(desc, para)
        -- 回合，每次替换一个
        return string.gsub(desc, "{round}", para[4], 1);
    end,
};
